<template>
  <!-- html 结构 -->
  <div class="preson">???</div>
</template>

<!-- 在vue3中监事一个reactive定义的响应式常量应该是这么写的 -->
<script lang="ts" name="Person" setup>
// @ 符号表示src根目录
import { type IPerson, type Persons } from "@/types";

// 定义一个person对象，要符合IPerson接口规范
let person: IPerson = {
  id: "werjddl01",
  name: "张三",
  age: 19,
};

// 定义一个变量，他是一个数组，数组中的每一项都符合IPerson的约束
let personList: Array<IPerson> = [
  {
    id: "werjddl01",
    name: "张三",
    age: 19,
  },
  {
    id: "werjddl01",
    name: "李四",
    age: 39,
  },
  {
    id: "werjddl01",
    name: "王五",
    age: 79,
  },
];

// 定义一个变量，他是一个数组，数组中的每一项都符合IPerson的约束
let personList2: Persons = [
  {
    id: "werjddl01",
    name: "张三",
    age: 19,
  },
  {
    id: "werjddl01",
    name: "李四",
    age: 39,
  },
  {
    id: "werjddl01",
    name: "王五",
    age: 79,
  },
];
</script>

<!-- scoped局部样式: -->
<style scoped>
.preson {
  background-color: rgb(120, 145, 46);
  box-shadow: 0 0 10px;
  border-radius: 10px;
}
/* 样式 */
button {
  background-color: aqua;
  margin: 5px;
}
</style>
